package io.binghe.seckill.domain.exception;

import io.binghe.seckill.domain.code.HttpCode;
import lombok.Data;

/**
 * @author: Dragon
 * @since: 2024/1/14 11:01
 */
@Data
public class SeckillException extends RuntimeException{

    private Integer code;

    public SeckillException(String message) {
        super(message);
    }

    public SeckillException(HttpCode errorCode) {
        this(errorCode.getCode(), errorCode.getMessage());
    }

    public SeckillException(Integer code, String message) {
        super(message);
        this.code = code;
    }
}
